package org.dawfinn.droiditarian.view;

import org.dawfinn.droiditarian.data.DeedsDBAdapter;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;

public class DeedCursorAdapter extends CursorAdapter {

	public DeedCursorAdapter(Context context, Cursor c) {
		super(context, c, false);
	}

	@Override
	public void bindView(View view, Context context, Cursor cursor) {
		DeedView deedView = (DeedView) view;
		deedView.setDeed(DeedsDBAdapter.cursorToDeed(cursor));
	}

	@Override
	public View newView(Context arg0, Cursor cursor, ViewGroup viewGroup) {
		DeedView deedView = new DeedView(arg0, DeedsDBAdapter
				.cursorToDeed(cursor));
		return deedView;
	}

}
